/*
 * mqtt.h
 *
 *  Created on: 2017
 *      Author: zjm
 */

#ifndef TABS_MQTT_H_
#define TABS_MQTT_H_

int get_mqtt_server(struct mg_connection *nc);
int get_mqtt_port(struct mg_connection *nc);
int get_mqtt_username(struct mg_connection *nc);
int get_mqtt_passwd(struct mg_connection *nc);

#define MQTT_PARAM_LIST	\
PARAM_ITEM(get_mqtt_server),\
PARAM_ITEM(get_mqtt_port),\
PARAM_ITEM(get_mqtt_username),\
PARAM_ITEM(get_mqtt_passwd),

int mqtt_save(struct mg_connection *nc,struct http_message *hm);
int mqtt_get(struct mg_connection *nc,struct http_message *hm);

#define MQTT_ACTION_LIST	\
		ACTION_ITEM(mqtt_save),	\
		ACTION_ITEM(mqtt_get),

#endif /* TABS_MQTT_H_ */
